import java.util.ArrayList;
import java.util.List;
import java.util.function.BiPredicate;
import java.util.function.Consumer;
import java.util.function.Supplier;
import java.util.stream.Stream;

public class  test<T> {
    //静态必须单独声明泛型类，因为相对独立
    public static <T> void testMain() {
        T t=null;
        System.out.println("ok");
        System.out.println(t);
    }
    public static void main(String[] args) {
       lambdaTest lambdatest=a->a;
       test2 test2=()->3;
       test3 tests=(x->x*2);
        System.out.println(test2.test());
        System.out.println(lambdatest.test1(1));
        System.out.println(tests.test(12));
        List<Integer> list=new  ArrayList();
        list.add(test2.test());
        list.add(lambdatest.test1(1));
        list.add(tests.test(12));
        //::java8的方法引用
        list.forEach(System.out::println);
       Stream stream= list.stream();
        Consumer<String> consumer=a->{
            System.out.println("ok");
        };
        Consumer<String> consumer1=System.out::println;
        consumer1.accept("sssss");
        Consumer<List> consumer2=list::removeAll;
        consumer2.accept(list);
        testClass testClass=new testClass();
        Consumer<Integer> consumer3=testClass::setA;
        consumer3.accept(2);
        list.forEach(System.out::println);
        BiPredicate<String,String> consumer4=(x, y)->x.equals(y);
        //等于
        BiPredicate<String,String> biPredicate=String::equals;
        Supplier<testClass> supplier=()->new testClass();
        //等于
        Supplier<testClass> supplier1=testClass::new;
      //  BiPredicate<Integer,testClass> biPredicate1=testClass::new;
        testInterface<Integer,testClass> testInterface=testClass::new;
    }
}
